package net.projects.pro5_rss.bean;

import lombok.Data;

import java.io.StringWriter;
import java.util.Date;
import java.util.Objects;

@Data
public class CommonInformationItem {
    private String title;
    private String txtDate;//从xml中得到的String日期
    private Date date;//转为Date型

    private String link;//链接
    private StringBuffer description;   //item的描述
    private String id;//Item的id
    private  String source;//rss源的名称


    // 生成文件名的方法
    public String getFileName() {
        StringWriter writer = new StringWriter();

        writer.append(source).append("_").append(String.valueOf(Objects.hashCode(title))).append(".xml");
        return writer.toString();
    }
}
